package com.example.demo.service.payService;

import com.alipay.easysdk.factory.Factory;
import com.alipay.easysdk.payment.page.models.AlipayTradePagePayResponse;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class PayService {
    @Value("${alipay.returnUrl}")
    private String returnUrl;
    public  Object pay(String orderId,String price) throws Exception {
        AlipayTradePagePayResponse response=  Factory.Payment.Page().pay("用户订单",
                orderId,
                price,
                returnUrl
        );
        return  response.body;
    }
}
